﻿<%@ page language="java" pageEncoding="UTF-8"%>
<%@page import="com.entity.CustomerDetailInfo"%>
<%@page import="com.entity.CustomerInfo"%>
<%@page import="com.entity.OrderInfo"%>
<%@page import="com.entity.OrderGoodsInfo"%>
<%@page import="java.util.ArrayList"%>
<%@page import="com.dao.GoodsInfoDAO"%>
<%@page import="com.entity.GoodsInfo"%>
<%@page import="com.dao.GoodsTypeDAO"%>
<%@page import="com.entity.GoodsType"%>
<%@page import="com.dao.CustomerDetailInfoDAO" %>
<%@page import="com.dao.CustomerInfoDAO" %>
<%@page import="java.text.DecimalFormat"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%
	ArrayList<OrderGoodsInfo> orderGoodsInfoList = (ArrayList<OrderGoodsInfo>)request.getAttribute("orderGoodsInfoList");
	OrderInfo of = (OrderInfo)request.getAttribute("orderInfo");
	//CustomerDetailInfo customerDetailInfo = (CustomerDetailInfo)request.getAttribute("customerDetailInfo");
	//CustomerInfo customerInfo = (CustomerInfo)request.getAttribute("customerInfo");
	//ArrayList<OrderInfo> obj = (ArrayList<OrderInfo>) request.getAttribute("obj");
	//OrderInfo en = obj.get(0);
	CustomerDetailInfoDAO cddao = new CustomerDetailInfoDAO();
	CustomerInfoDAO cdao = new CustomerInfoDAO();
	CustomerDetailInfo customerDetailInfo = cddao.getCustomerDetailInfo(of.getCustomerId());
    CustomerInfo customerInfo = cdao.getCustomerInfo(customerDetailInfo.getCustomerId());
 %>
<html>
  <head>
    <title>就诊详细信息</title>
    <script type="text/javascript" src="../js/third/manageOrder.js" charset="utf-8"></script>
  </head>
  <body>
   	<table style="font-size:13px;" width="100%" height="390">
  <tr>
    <td colspan="6"><font color="#666666" size="3">&nbsp;就诊详细信息</font></strong></td>
  </tr>
  <tr>
    <td height="15" colspan="6"><hr  width="100%" style="height: 2px;"/></td>
  </tr>
  <tr height="40px">
    <td><strong>就诊编号：</strong></td>
    <td width="200" align="left"><%=of.getOrderId()%></td>
    <td><strong>就诊状态：</strong></td>
    <td width="200" align="left">
    	<%
    		if(of.getStatus() == 0){
    			out.println("已挂号排队中");
    		}else if (of.getStatus() == 1) {
    			out.println("检查缴费");
    		}else if (of.getStatus() == 100) {
    			out.println("治疗完毕");
    		}else if (of.getStatus() == 101) {
    			out.println("已复诊");
    		}else{
    			out.println("已过期");
    		}
    	%>
    </td>
    <td><strong>就诊时间：</strong></td>
    <td width="200" align="left"><%=of.getOrderTime()%></td>
  </tr>
  <tr height="40px">
    <td><strong>患者编号：</strong></td>
    <td><%=of.getCustomerId()%></td>
    <td><strong>患者账号/编号：</strong></td>
    <td><%=customerInfo.getEmail()%></td>
    <td><strong>注册时间：</strong></td>
    <td><%=customerInfo.getRegisterTime()%></td>
  </tr>
  <tr height="40px">
    <td><strong>患者姓名：</strong></td>
    <td><%=customerDetailInfo.getName()%></td>
    <td width="90"><strong>移动电话：</strong></td>
    <td><%if(customerDetailInfo.getMovePhone() == null){out.println("无");}else{out.println(""+customerDetailInfo.getMovePhone()+"");}%></td>
  </tr>
  <tr height="40px">
    <td><strong>家庭地址：</strong></td>
    <td colspan="5"><%=customerDetailInfo.getAddress()%></td>
   </tr>
   <tr>
    <td colspan="6">
    	<table width="100%" border="1" cellpadding="0" cellspacing="0" style="font-size:13px"  bordercolor="#cccccc">
	      <tr height="30">
	        <td><div align="center"><font color="#666666">坐诊编号</font></div></td>
	        <td><div align="center"><font color="#666666">科室类别</font></div></td>
	        <td><div align="center"><font color="#666666">显示名称</font></div></td>
	        <td><div align="center"><font color="#666666">挂号费用</font></div></td>
 	       </tr>
	      <%
	      		double sum = 0;
	      		DecimalFormat df = new DecimalFormat("0.00");
	      		if(orderGoodsInfoList != null){
	      			for(int i=0;i<orderGoodsInfoList.size();i++){
	      				OrderGoodsInfo orderGoodsInfo = orderGoodsInfoList.get(i);
	      				GoodsInfoDAO gdao = new GoodsInfoDAO();
	      				GoodsInfo goodsInfo = gdao.getQueryGoodsInfo(orderGoodsInfo.getGoodsId());
	      				sum +=  goodsInfo.getPrice();
	      				String price = df.format(goodsInfo.getPrice());
	      		 	 	out.println("<tr height='30'>");
	      				out.println("<td><div align='center'><font color='#666666'>"+goodsInfo.getGoodsId()+"</font></div></td>");
	      				out.println("<td><div align='center'><font color='#666666'>"+goodsInfo.getTypeDetailInfo()+"</font></div></td>");
	      				out.println("<td><div align='center'><font color='#666666'>"+goodsInfo.getGoodsName()+"</font></div></td>");
	      				out.println("<td><div align='center'><font color='#666666'>"+price+"</font></div></td>");
 	       			}
	      		}
	       %>

    </table>
    </td>
  </tr>
 <tr>
    <td colspan="6"><div align="left"><input type="button" value="返回" onClick="JavaScript:history.go(-1);" style="width: 50px; height: 26px;padding-top: 3px"/></div></td>
  </tr>
</table>
  </body>
</html>
